//
//  WDArrivalServiceDetailModel.h
//  wd-serviceapp
//
//  Created by Bin Tang on 2024/8/29.
//

#import "TYZBaseModel.h"
#import "WDBatteryInfoModel.h" // 电池信息
#import "WDInspectUploadModel.h" // 工单流程 * 检查 * 照片视频上传
#import "WDTaskFlowModel.h"
#import "MaintainItemModel.h" // 保养项目
#import "RepairItemModel.h" // 维修项目
#import "WDCanFaultInfoModel.h"
#import "WDServiceDetailCancelModel.h" // 取消信息

NS_ASSUME_NONNULL_BEGIN

/// 工单详情
@interface WDArrivalServiceDetailModel : TYZBaseModel

/// 销售日期
@property (nonatomic, assign) double aakSalesDate;

/// 销售日期-经销商到用户
@property (nonatomic, copy) NSString *aakSalesDateValue;

/// 行程里程
@property (nonatomic, assign) float totalMile;

/// 用户APP 车主绑定车主ID
@property (nonatomic, assign) NSInteger appUserId;

/// 用户APP 车主绑定车主姓名
@property (nonatomic, copy) NSString *appUserName;

/// 用户APP 车主注册手机号
@property (nonatomic, copy) NSString *appUserPhone;

/// 保修司机
//@property (nonatomic, copy) NSString *repairDriver;

/// 保修电话
//@property (nonatomic, copy) NSString *repairPhone;

/// 预约时间(年月日时分秒)
@property (nonatomic, copy) NSString *appointmentTime;

/// 报修/保养描述 文字
@property (nonatomic, copy) NSString *detail;
@property (nonatomic, assign) float detailHeight;

@property (nonatomic, assign) NSInteger id;

/// 保养项目
@property (nonatomic, copy) NSString *maintainItems;

/// 保养项目数组
@property (nonatomic, strong) NSArray<MaintainItemModel *> *maintainItemList;

/// 预约方式 0.APP预约 1.400客服电话 2.自主到站
@property (nonatomic, assign) NSInteger orderType;

/// 预约方式
@property (nonatomic, copy) NSString *orderTypeValue;

/// 车牌号
@property (nonatomic, copy) NSString *plateNumber;

/// 接车时间
@property (nonatomic, copy) NSString *receiveTime;

/// 维修项目
@property (nonatomic, copy) NSString *repairItems;

@property (nonatomic, strong) NSArray<RepairItemModel *> *repairItemList;


/// 服务流程 0.待分派 1.待接车 2.检查中 3.维修中 4.待报单 5.已完成 6.已取消 7.已关闭
@property (nonatomic, assign) NSInteger servFlow;

/// 服务流程
@property (nonatomic, copy) NSString *servFlowValue;

/// 服务类型 0.车辆保养 1.车辆维修
@property (nonatomic, assign) NSInteger servType;

/// 服务类型
@property (nonatomic, copy) NSString *servTypeValue;

/// 服务站ID
@property (nonatomic, assign) NSInteger stationId;

/// 服务站名称
@property (nonatomic, copy) NSString *stationName;

/// 工单状态 0停用 1启用
@property (nonatomic, assign) NSInteger status;

/// 工单号 系统自动生成
@property (nonatomic, copy) NSString *taskNo;

/// 工单类型 0.站内维修 1.外出救援
@property (nonatomic, assign) NSInteger taskType;

/// 工单类型
@property (nonatomic, copy) NSString *taskTypeValue;

/// 租户ID
@property (nonatomic, copy) NSString *tenantId;

/// 创建时间
@property (nonatomic, copy) NSString *createTime;

/// 抢单时间
@property (nonatomic, copy) NSString *asignTime;

/// 车辆电池
@property (nonatomic, copy) NSString *vehicleBattery;

/// 车ID
@property (nonatomic, assign) NSInteger vehicleId;

/// VIN号 底盘号
@property (nonatomic, copy) NSString *vehicleVin;

/// 车辆位置（唐斌临时加）
@property (nonatomic, copy) NSString *vehicleAds;
@property (nonatomic, assign) float vehicleAdsHeight;

/// 处理说明（临时加）
//@property (nonatomic, copy) NSString *workExplain;
//@property (nonatomic, assign) float workExplainHeight;

/// 电池列表
@property (nonatomic, strong) NSArray<WDBatteryInfoModel *> *batteryList;

/// 车辆CAN历史故障
@property (nonatomic, strong) NSArray<WDCanFaultInfoModel *> *canFaultInfoList;

/// 工单流程 * 检查 * 照片视频上传
@property (nonatomic, strong) WDInspectUploadModel *inspectUploadMap;

/// 用户反馈照片
@property (nonatomic, strong) NSArray<WDInspectUploadModel *> *problemPhotoList;

/// 用户反馈视频
@property (nonatomic, strong) NSArray<WDInspectUploadModel *> *problemVideoList;

/// 用户反馈照片视频
@property (nonatomic, strong) WDInspectUploadModel *problemUploadMap;

/// 工单流程 * 报修 * 照片视频上传
@property (nonatomic, strong) WDInspectUploadModel *repairUploadMap;

/// 工单流程列表
@property (nonatomic, strong) NSArray<WDTaskFlowModel *> *taskFlowList;

/// 工作流维修中
@property (nonatomic, strong) NSMutableArray<WDTaskFlowModel *> *tmpTaskFlows;

/// 待接车流程
@property (nonatomic, strong) WDTaskFlowModel *meetCarFlowModel;

/// 检查中流程
@property (nonatomic, strong) WDTaskFlowModel *inspectFlowModel;

/// 工单关闭信息
@property (nonatomic, strong, nullable) WDServiceDetailCancelModel *cancel;


/// 其它
//@property (nonatomic, strong) NSArray *otherImageVideos;
@property (nonatomic, assign) float imageWidth;
@property (nonatomic, assign) float imageHeight;
//@property (nonatomic, assign) float otherImageVideosHeight;




#pragma mark - 外出救援特有字段


/// 保修司机
@property (nonatomic, copy) NSString *repairDriver;

/// 保修电话
@property (nonatomic, copy) NSString *repairPhone;

/// 外出救援 救援地址
@property (nonatomic, copy) NSString *rescueAddress;
@property (nonatomic, assign) float rescueAddressHeight;

/// 外出救援 救援定位与服务站距离
@property (nonatomic, strong) NSNumber *rescueDistance;

/// 外出救援 救援定位 纬度
@property (nonatomic, assign) double rescueLatitude;

/// 外出救援 救援定位 经度
@property (nonatomic, assign) double rescueLongitude;

/// 申请类型。 0 救援申请；1 取消救援；2 工单取消
@property (nonatomic, strong) NSNumber *applyType;

/// 申请状态。 0 待申请；1 待审核；2 同意；3 驳回
@property (nonatomic, strong) NSNumber *auditStatus;


/// 完成检查时间
@property (nonatomic, copy) NSString *inspectTime;

/// 完成时间
@property (nonatomic, copy) NSString *finishTime;

/// 初始是否外出救援工单 默认0站内 1外出救援
@property (nonatomic, strong) NSNumber *isRescue;

/// 末次定位时间
@property (nonatomic, assign) double lastLocationCtime;

/// 末次纬度lat
@property (nonatomic, assign) double lastVehicleLat;

/// 末次经度lng
@property (nonatomic, assign) double lastVehicleLng;


@end

NS_ASSUME_NONNULL_END

/*
 {
     "taskFlowList": [],
     "inspectUploadMap": {
         "0": [{
             "id": "1829784270553071618",
             "createUser": "0",
             "createDept": "0",
             "createTime": "2024-08-31 15:32:21",
             "updateUser": "0",
             "updateTime": "2024-08-31 15:32:21",
             "status": 1,
             "isDeleted": 0,
             "tenantId": "",
             "taskId": "1829781283726278657",
             "flowId": "1829784270444019714",
             "servFlow": 2,
             "mediaType": 0,
             "uploadType": 0,
             "uploadUrl": "https://wd-test-202305.bj.bcebos.com/wd-test-202305/upload/20240831/b4061a0a08fbc1e3f3ebce39ca72ebe3.jpeg"
         }, {
             "id": "1829784270574043138",
             "createUser": "0",
             "createDept": "0",
             "createTime": "2024-08-31 15:32:21",
             "updateUser": "0",
             "updateTime": "2024-08-31 15:32:21",
             "status": 1,
             "isDeleted": 0,
             "tenantId": "",
             "taskId": "1829781283726278657",
             "flowId": "1829784270444019714",
             "servFlow": 2,
             "mediaType": 0,
             "uploadType": 1,
             "uploadUrl": "https://wd-test-202305.bj.bcebos.com/wd-test-202305/upload/20240831/6bc2c1a2f9799da4b1bb49eb42a92099.jpeg"
         }, {
             "id": "1829784270586626050",
             "createUser": "0",
             "createDept": "0",
             "createTime": "2024-08-31 15:32:21",
             "updateUser": "0",
             "updateTime": "2024-08-31 15:32:21",
             "status": 1,
             "isDeleted": 0,
             "tenantId": "",
             "taskId": "1829781283726278657",
             "flowId": "1829784270444019714",
             "servFlow": 2,
             "mediaType": 0,
             "uploadType": 2,
             "uploadUrl": "https://wd-test-202305.bj.bcebos.com/wd-test-202305/upload/20240831/3d3b9b8bdb83b4c15a55aa79d270703e.jpeg"
         }, {
             "id": "1829784270603403266",
             "createUser": "0",
             "createDept": "0",
             "createTime": "2024-08-31 15:32:21",
             "updateUser": "0",
             "updateTime": "2024-08-31 15:32:21",
             "status": 1,
             "isDeleted": 0,
             "tenantId": "",
             "taskId": "1829781283726278657",
             "flowId": "1829784270444019714",
             "servFlow": 2,
             "mediaType": 0,
             "uploadType": 3,
             "uploadUrl": "https://wd-test-202305.bj.bcebos.com/wd-test-202305/upload/20240831/3b19ed0dd4c26c9f91bacafc3d265b24.jpeg"
         }, {
             "id": "1829784270615986177",
             "createUser": "0",
             "createDept": "0",
             "createTime": "2024-08-31 15:32:21",
             "updateUser": "0",
             "updateTime": "2024-08-31 15:32:21",
             "status": 1,
             "isDeleted": 0,
             "tenantId": "",
             "taskId": "1829781283726278657",
             "flowId": "1829784270444019714",
             "servFlow": 2,
             "mediaType": 0,
             "uploadType": 4,
             "uploadUrl": "https://wd-test-202305.bj.bcebos.com/wd-test-202305/upload/20240831/a0848826d2a3e41bd2f6cb5be29bdb99.jpeg"
         }, {
             "id": "1829784270628569090",
             "createUser": "0",
             "createDept": "0",
             "createTime": "2024-08-31 15:32:21",
             "updateUser": "0",
             "updateTime": "2024-08-31 15:32:21",
             "status": 1,
             "isDeleted": 0,
             "tenantId": "",
             "taskId": "1829781283726278657",
             "flowId": "1829784270444019714",
             "servFlow": 2,
             "mediaType": 0,
             "uploadType": 5,
             "uploadUrl": "https://wd-test-202305.bj.bcebos.com/wd-test-202305/upload/20240831/a25dfa53eb0e5a90d4ceeaba496b274d.jpeg"
         }]
     },
     "repairUploadMap": {
         "0": [{
             "id": "1831120656270991362",
             "createUser": "0",
             "createDept": "0",
             "createTime": "2024-09-04 08:02:40",
             "updateUser": "0",
             "updateTime": "2024-09-04 08:02:40",
             "status": 1,
             "isDeleted": 0,
             "tenantId": "",
             "taskId": "1829781283726278657",
             "flowId": "1831120656178716673",
             "servFlow": 3,
             "mediaType": 0,
             "uploadType": 0,
             "uploadUrl": "https://wd-test-202305.bj.bcebos.com/wd-test-202305/upload/20240904/8d67327581effd377bc87d60b33846b7.jpeg"
         }, {
             "id": "1831120656287768578",
             "createUser": "0",
             "createDept": "0",
             "createTime": "2024-09-04 08:02:40",
             "updateUser": "0",
             "updateTime": "2024-09-04 08:02:40",
             "status": 1,
             "isDeleted": 0,
             "tenantId": "",
             "taskId": "1829781283726278657",
             "flowId": "1831120656178716673",
             "servFlow": 3,
             "mediaType": 0,
             "uploadType": 1,
             "uploadUrl": "https://wd-test-202305.bj.bcebos.com/wd-test-202305/upload/20240904/b7aa97b223a5265b9d2fd5a86c272534.jpeg"
         }, {
             "id": "1831120656296157186",
             "createUser": "0",
             "createDept": "0",
             "createTime": "2024-09-04 08:02:40",
             "updateUser": "0",
             "updateTime": "2024-09-04 08:02:40",
             "status": 1,
             "isDeleted": 0,
             "tenantId": "",
             "taskId": "1829781283726278657",
             "flowId": "1831120656178716673",
             "servFlow": 3,
             "mediaType": 0,
             "uploadType": 2,
             "uploadUrl": "https://wd-test-202305.bj.bcebos.com/wd-test-202305/upload/20240904/c4de59f6a321b5e30d7ad635b27c7b47.jpeg"
         }, {
             "id": "1831120656308740098",
             "createUser": "0",
             "createDept": "0",
             "createTime": "2024-09-04 08:02:40",
             "updateUser": "0",
             "updateTime": "2024-09-04 08:02:40",
             "status": 1,
             "isDeleted": 0,
             "tenantId": "",
             "taskId": "1829781283726278657",
             "flowId": "1831120656178716673",
             "servFlow": 3,
             "mediaType": 0,
             "uploadType": 3,
             "uploadUrl": "https://wd-test-202305.bj.bcebos.com/wd-test-202305/upload/20240904/73dbdeca9d911578113d2d13e1606d28.jpeg"
         }]
     },
     "status": 1,
     "cancel": {}
 }
 */
